Optimal. Leaf size=27 \[ -\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\sin (x) \cos (x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0911225, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3872, 2839, 2638, 2635, 8} \[ -\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\sin (x) \cos (x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3872
Rule 2839
Rule 2638
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \frac{\cos ^2(x)}{a+a \csc (x)} \, dx &=\int \frac{\cos ^2(x) \sin (x)}{a+a \sin (x)} \, dx\\ &=\frac{\int \sin (x) \, dx}{a}-\frac{\int \sin ^2(x) \, dx}{a}\\ &=-\frac{\cos (x)}{a}+\frac{\cos (x) \sin (x)}{2 a}-\frac{\int 1 \, dx}{2 a}\\ &=-\frac{x}{2 a}-\frac{\cos (x)}{a}+\frac{\cos (x) \sin (x)}{2 a}\\ \end{align*}
Mathematica [A] time = 0.0337815, size = 27, normalized size = 1. \[ -\frac{x}{2 a}+\frac{\sin (2 x)}{4 a}-\frac{\cos (x)}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.058, size = 87, normalized size = 3.2 \begin{align*} -{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3} \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{ \left ( \tan \left ( x/2 \right ) \right ) ^{2}}{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{a}\tan \left ({\frac{x}{2}} \right ) \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{1}{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-{\frac{1}{a}\arctan \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.59781, size = 109, normalized size = 4.04 \begin{align*} \frac{\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac{2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac{\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 2}{a + \frac{2 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}} - \frac{\arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.465767, size = 51, normalized size = 1.89 \begin{align*} \frac{\cos \left (x\right ) \sin \left (x\right ) - x - 2 \, \cos \left (x\right )}{2 \, a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\cos ^{2}{\left (x \right )}}{\csc{\left (x \right )} + 1}\, dx}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.3458, size = 59, normalized size = 2.19 \begin{align*} -\frac{x}{2 \, a} - \frac{\tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} - \tan \left (\frac{1}{2} \, x\right ) + 2}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}^{2} a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]